package com.itheima.controller;

import com.itheima.pojo.OperateLog;
import com.itheima.pojo.PageResult;
import com.itheima.pojo.Result;
import com.itheima.service.LogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/log")
@Slf4j
public class LogController {
    @Autowired
    private LogService logService;
    /**
     * 记录日志
     */
    @GetMapping("/page")
    public Result storeLog(Integer page, Integer pageSize){
       PageResult<OperateLog> operateLogs =logService.storeLog(page, pageSize);
       return Result.success(operateLogs);


    }
}
